<template>
    <div>
        <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="68px" class="formBox">
            <el-row style="font-size:15px">
                <el-col :span="5"><span class="header">顾客姓名：</span>{{ queryParams.patientName }}</el-col>
                <el-col :span="3"><span class="header">顾客ID：</span> {{ queryParams.patientId }}</el-col>
                <el-col :span="6"><span class="header">顾客编号：</span>{{ queryParams.visitNum }}</el-col>
                <el-col :span="2"><span class="header">性别：</span>{{ matchDict("sys_user_sex", queryParams.sex) }}</el-col>
                <el-col :span="2"><span class="header">年龄：</span>{{ queryParams.age }}</el-col>
                <el-col :span="6"><span class="header">首诊时间：</span>{{ queryParams.doctorTime }}</el-col>
            </el-row>
            <el-row style="font-size:15px;margin-top:10px;">
                <el-col :span="24"><span class="header">状态：</span><span style="color:red;font-size:15px;font-weight:700;">{{
                    matchDict("sys_diagnosis_status", queryParams.status) }}</span></el-col>
            </el-row>
            <el-row style="font-size:15px;margin-top:10px;">
                <el-col :span="24"><span class="header">诊断：</span><span style="color:red;font-size:15px;font-weight:700;">{{
                    queryParams.doctorDiagnosis }}</span></el-col>
            </el-row>
            <el-row style="font-size:15px;margin-top:10px;">
                <el-col :span="24"><span class="header">方案：</span><span style="color:red;font-size:15px;font-weight:700;">{{
                    queryParams.doctorPlan }}</span></el-col>
            </el-row>
            <el-row style="font-size:15px;margin-top:10px;">
                <el-col :span="24"><span class="header">计划随访日期：</span><span style="color:red;font-size:15px;font-weight:700;"></span></el-col>
            </el-row>
                <!-- <el-form-item label="顾客编号" prop="visitNum">
                    <el-input v-model="queryParams.visitNum" placeholder="请输入顾客编号" :disabled="true" clearable
                        style="width: 160px" />
                </el-form-item>
                <el-form-item label="姓名" prop="patientName">
                    <el-input v-model="queryParams.patientName" placeholder="请输入顾客姓名" :disabled="true" clearable
                        style="width: 140px" />
                </el-form-item>
                <el-form-item label="随访方式" prop="planType" clearable>
                    <el-select v-model="queryParams.planType" placeholder="随访方式" clearable filterable :disabled="true"
                        style="width: 140px">
                        <el-option v-for="dict in plansTypes" :key="dict.value" :label="dict.label" :value="dict.value" />
                    </el-select>
                </el-form-item> -->
                <!-- <el-form-item label="计划随访日期" prop="planDate" clearable label-width="100px">
                    <el-date-picker v-model="queryParams.planDate" type="date" placeholder="选择日期">
                    </el-date-picker>
                </el-form-item> -->
                <el-row style="margin-top:20px;">
                    <el-form-item label="随访内容" prop="content">
                        <el-input v-model="content" type="textarea" :rows="10" placeholder="请输入随访内容" clearable
                            style="width:600px;margin-bottom:15px" />
                    </el-form-item>
                </el-row>
                <el-row>
                    <el-form-item label="随访日期" prop="DateTimeValue" :clearable="false">
                        <el-date-picker v-model="DateTimeValue" type="date" placeholder="选择日期" :clearable="false">
                        </el-date-picker>
                    </el-form-item>
                    <el-form-item label="随访人" prop="planName" :clearable="false">
                        <el-input v-model="planName" placeholder="请输入随访人" style="width:160px"></el-input>
                    </el-form-item>
                </el-row>
            </el-form>
            <el-button class="Addbtn" @click="submitEvent">提交</el-button>
    </div>
</template>

<script>
import { mapGetters } from "vuex";
export default {
    name: "addRecord",
    dicts: ["sys_textmanage_type", 'sys_manage_diseases','sys_user_sex','sys_diagnosis_status'],
    components: {  },
    props: ['basicInfo'],
    data() {
        return {
            plansTypes: [
                {
                    value: "1",
                    label: '电话'
                }, {
                    value: "5",
                    label: '微信'
                }
            ],
            currentTab: 'followRecord',
            queryParams: {
                visitNum: undefined,
                patientName: undefined,
                planType: "1",
                planDate: ''
            },
            content: '',//随访内容
            DateTimeValue: '',//随访日期
            planName: '',//随访人
        };
    },
    watch: {},
    created() {

    },
    computed: {
        ...mapGetters(["nickName"]),
        defaultTime: function () {
            let date = new Date();
            let year = date.getFullYear();
            let month = date.getMonth() + 1;
            let day = date.getDate();
            month = month > 9 ? month : "0" + month;
            day = day < 10 ? "0" + day : day;
            let today = year + "-" + month + "-" + day;
            return today;
        },
        isAdmin() {
            return this.$store.state.user.name === 'admin' ? true : false
        }
    },
    mounted() {
        this.queryParams = this.basicInfo
        // this.queryParams.visitNum = this.basicInfo.visitNum
        // this.queryParams.patientName = this.basicInfo.patientName
        this.planName = this.nickName
        this.DateTimeValue = this.defaultTime
    },

    methods: {
        matchDict: function (key, id) {
            let _this = this;
            const result = _this.dict.type[key];
            let textValue = "";
            result.forEach((item) => {
                if (item.raw.dictValue == id) {
                    textValue = item.raw.dictLabel;
                }
            });
            return textValue;
        },
        submitEvent(){
          this.$emit('closeFollow')
        }
    },
};
</script>
<style scoped>
.header {
    font-weight: bold;
}

.Addbtn {
    background-color: #f3a4a1;
    color: white;
    margin: 0 auto;
    display: block;
}
</style>
